package mode23.factory;

/**
 * @author wanglei
 * @since 2024-04-15
 */
public class CoffeeFactory {
    public static Coffee makeCoffee(String type) {
        if ("americano".equals(type)) {
            return new Americano();
        } else if ("latte".equals(type)) {
            return new Latte();
        } else {
            throw new IllegalArgumentException("Invalid coffee type");
        }
    }
}
